import Vue from 'vue'
import VueRouter from 'vue-router'
import BookManage from "../views/BookManage";
import AddBook from "../views/AddBook";
import Index from "../views/Index";
import UpdateBook from "../views/UpdateBook";

Vue.use(VueRouter)

const routes = [
    {
        path: "/",
        name: "图书管理",
        component: Index,
        redirect: "/bookManage",
        children: [
            {
                path: "/bookManage",
                name: "查询图书",
                show:true,
                component: BookManage
            },
            {
                path: "/addBook",
                name: "添加图书",
                show:true,
                component: AddBook
            },
            {
                path: "/updateBook",
                //name: "编辑图书",
                show:false,
                component: UpdateBook
            }
        ]
    },

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
